<?php

include 'config.php';

$sql = "SELECT s.*,n.number_name,b.breed_name,t.type_name FROM stock_goods_log s left join `number` n on s.number_id=n.number_id left join breed b on s.breed_id=b.breed_id left join type t on s.type_id=t.type_id WHERE 1 ORDER BY s.stock_goods_id DESC LIMIT 0,15";
//$sql .= " where 1 ORDER BY s.stock_goods_id DESC limit 0,10";
$rs = $mysql->execute($sql);
$array = array();
$n = 0;
while($row = mysql_fetch_assoc($rs)){
	$n = $n;
	$num = $n%2;
	$row['num'] = $num;
	$array[] = $row;
	$n++;
}
$time = date("Y-m-d",time());
$smarty->assign('time',$time);
$smarty->assign('link', 2);
$smarty->assign('arr', $array);
$smarty->display('purchase.html');